//2.  从键盘输入一串字符，存放到一个文件
#include<stdio.h>

int main(int argc,char **argv)
{
	if(argc < 2)
	{
		printf("notice: %s  file\n",argv[0]);
		return -1;
	}
	FILE *fp;
	if((fp = fopen(argv[1], "w+")) == NULL)
	{
		printf("打开失败！\n");
		return -1;
	}
	char ch;
	printf("请输入一串字符：\n");
	while((ch = getchar()) != '\n')
	{
		fputc(ch,fp);
	}
	fclose(fp);
	return 0;
}
